{extend name="mainadmin@layouts/base" /}
{block name="main" }
<script type="text/javascript" src="__STATIC__/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="__STATIC__/js/highcharts/highcharts_more.js"></script>
<header class="header  b-b clearfix">
        <div class="page-breadcrumbs">
            <ul class="breadcrumb" >
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>汇总统计</strong>
                </li>
            </ul>
            {if condition="$supplyer_id > 0"}
            <a href="{:url('order',['supplyer_id'=>-1])}" class="fr m-r">正在查看【{$supplyer_name}】点击查看全部</a>
            {/if}
        </div>
</header>
<section class="scrollable wrapper  ">
    <section class="panel panel-default ">
        <div class="row m-l-none m-r-none bg-light lter">
            <div class="col-sm-6 col-md-3 padder-v b-r b-light ">

                <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-danger"></i>
                            <i class="fa fa-clipboard  fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#f5f5f5" data-scale-color="false" data-size="50"
                                  data-line-cap="butt" data-animate="3000" data-target="#firers"
                                  data-update="5000"></span>
                        </span>
                <a class="fl" >
                    <span class="h3 block m-t-xs"><strong id="t_day_order_num">0</strong></span>
                    <small class="text-muted text-uc">今天下单数</small>
                </a>
                <a class="fr">
                    <span class="h3 block m-t-xs"><strong id="y_day_order_num">0</strong></span>
                    <small class="text-muted text-uc">昨天下单数</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                        <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-warning"></i>
                            <i class="fa fa-yen fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#fff" data-scale-color="false" data-size="50" data-line-cap="butt"
                                  data-animate="2000" data-target="#bugs" data-update="3000"></span>
                        </span>
                <a class="fl" >
                    <span class="h3 block m-t-xs"><strong id="t_day_pay_num">0</strong></span>
                    <small class="text-muted text-uc">今天成交金额</small>
                </a>
                <a class="fr">
                    <span class="h3 block m-t-xs"><strong id="y_day_pay_num">0</strong></span>
                    <small class="text-muted text-uc" >昨天成交金额</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light">
                       <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-info"></i>
                            <i class="fa fa-truck fa-stack-1x text-white"></i>
                        </span>
                <a class="fl" >
                    <span class="h3 block m-t-xs"><strong id="t_day_wait_shipping_num">0</strong></span>
                    <small class="text-muted text-uc">待发货订单</small>
                </a>
                <a class="fr" >
                    <span class="h3 block m-t-xs"><strong id="y_day_shipping_num">0</strong></span>
                    <small class="text-muted text-uc">昨天发货订单</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                        <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x icon-muted"></i>
                            <i class="fa fa-legal fa-stack-1x text-white"></i>
                        </span>
                <a class="fl" >
                    <span class="h3 block m-t-xs"><strong id="t_day_sign_num">0</strong></span>
                    <small class="text-muted text-uc">今天签收订单</small>
                </a>
                <a class="fr" >
                    <span class="h3 block m-t-xs"><strong id="y_day_sign_num">0</strong></span>
                    <small class="text-muted text-uc">昨天签收订单</small>
                </a>
                <div class="clearfix"></div>
            </div>
        </div>
    </section>

    <section class="panel panel-default ">
        <div class="row m-l-none m-r-none bg-light lter">
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                 <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                      <i class="fa fa-circle fa-stack-2x text-danger"></i>
                      <i class="fa fa-gift  fa-stack-1x text-white"></i>
                      <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                            data-track-color="#f5f5f5" data-scale-color="false" data-size="50"
                            data-line-cap="butt" data-animate="3000" data-target="#firers"
                            data-update="5000"></span>
                 </span>
                <a class="fl" href="#">
                    <span class="h3 block m-t-xs"><strong>{$goods.all_num|intval}</strong></span>
                    <small class="text-muted text-uc">全部商品</small>
                </a>
                <a class="fr" href="#">
                    <span class="h3 block m-t-xs"><strong>{$goods.sale_num|intval}</strong></span>
                    <small class="text-muted text-uc">销售中商品</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light ">
                 <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                      <i class="fa fa-circle fa-stack-2x text-danger"></i>
                      <i class="fa fa-gift  fa-stack-1x text-white"></i>
                      <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                            data-track-color="#f5f5f5" data-scale-color="false" data-size="50"
                            data-line-cap="butt" data-animate="3000" data-target="#firers"
                            data-update="5000"></span>
                 </span>
                <a class="fl" href="#">
                    <span class="h3 block m-t-xs"><strong >{$goods.check_num|intval}</strong></span>
                    <small class="text-muted text-uc">审核中商品</small>
                </a>
                <a class="fr" href="#">
                    <span class="h3 block m-t-xs"><strong >{$goods.obtained_num|intval}</strong></span>
                    <small class="text-muted text-uc">平台下架</small>
                </a>
                <div class="clearfix"></div>
            </div>
        </div>
    </section>


        <section class="panel panel-default ">
            <header class="panel-heading font-bold">
                <form id="forms" onsubmit="return evalstat();" >
                <div class="form-group">
                    <a class="btn btn-default " data-toggle="reportrange" data-change="submit">
                        <i class="fa fa-calendar fa-lg"></i>
                        <small>下单时间</small>
                        <span></span> <b class="caret"></b>
                        <input type="hidden" value="{$start_date} - {$end_date}" id="reportrange" name="reportrange" />
                    </a>
                </div>
                </form>
            </header>
            <div class="panel-body">
                <!--   style="height: 210px"  -->
                <div id="container"></div>
            </div>
            <footer class="panel-footer bg-white no-padder">
                <div class="row text-center no-gutter">

                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block" id="total_add_num">0</span>
                        <small class="text-muted m-b block">下单总数</small>
                    </div>
                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block" id="total_pay_num">0</span>
                        <small class="text-muted m-b block">成交总数</small>
                    </div>
                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block" id="total_shpping_num">0</span>
                        <small class="text-muted m-b block">发货总数</small>
                    </div>
                    <div class="col-xs-3">
                        <span class="h4 font-bold m-t block" id="total_sign_num">0</span>
                        <small class="text-muted m-b block">签收总数</small>
                    </div>
                </div>
            </footer>
        </section>


</section>
<script type="text/javascript">
    var the_first = true;
    function evalstat() {
        var arr = $('#forms').toJson();
        arr.supplyer_id = {$supplyer_id};
        jq_ajax('{:url("evalStat")}',arr,function(res){
            if (the_first == true){
                the_first = false;
                $('#t_day_order_num').html(res.stats.today.all_add_num);
                $('#y_day_order_num').html(res.stats.yesterday.all_add_num);
                $('#t_day_pay_num').html(res.stats.today.order_pay_num);
                $('#y_day_pay_num').html(res.stats.yesterday.order_pay_num);
                $('#t_day_wait_shipping_num').html(res.stats.today.wait_shipping_num);
                $('#y_day_wait_shipping_num').html(res.stats.yesterday.wait_shipping_num);
                $('#t_day_sign_num').html(res.stats.today.sign_num);
                $('#y_day_sign_num').html(res.stats.yesterday.sign_num);
            }

            $('#total_add_num').html(res.stats.total_add_num);
            $('#total_pay_num').html(res.stats.total_pay_num);
            $('#total_shpping_num').html(res.stats.total_shpping_num);
            $('#total_sign_num').html(res.stats.total_sign_num);
            $('#container').highcharts({
                    chart: {type: 'spline'},
                    title: {text: ''},
                    subtitle: {text: ''},
                    xAxis: { categories: res.riqi},
                    yAxis: {
                    title: {text: ''},
                    min: 0
                },
                tooltip: {
                    formatter: function () {
                        return '<b>时间:' + this.x + '</b><br>' + this.series.name + ': ' + this.y + '';
                    }
                },
                series: [{
                    name: '下单数 <span style="color:gray" >(点击隐藏)</span>',
                    data: res.stats.all_add_num
                },{
                    name: '成交数 <span style="color:gray" >(点击隐藏)</span>',
                    data: res.stats.order_pay_num
                },{
                    name: '发货数 <span style="color:gray" >(点击隐藏)</span>',
                            data:res.stats.shipping_order_num
                }, {
                    name: '签收数 <span style="color:gray" >(点击隐藏)</span>',
                    data:res.stats.sign_order_num
                }]
            });

        })
        return false;
    }
    $(function(){
        evalstat();
    })
</script>
{/block}
